package com.ms.pda.extensions

import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.BindingAdapter
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.ms.pda.adapter.*
import com.ms.pda.model.table.StorageOutDO
import com.ms.pda.model.vo.StorageOutVo

object StorageBindingAdapter {

    /**
     * 无单出库
     */
    @JvmStatic
    @BindingAdapter(value = ["orderOutAdapter", "orderOutData"])
    fun RecyclerView.orderOutAdapter(activity: AppCompatActivity, data: List<StorageOutVo>) {
        if (this.adapter == null) {
            this.layoutManager = LinearLayoutManager(activity)
            this.adapter = StorageOutRVAdapter()
        }
        ((this.adapter) as StorageOutRVAdapter).setList(data)
    }

}